<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>邮件管理</title>
<link href="/widget/bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet"  type="text/css"/>
<link href="/widget/iconfont/iconfont.css" rel="stylesheet" />
 {cssjs}
<link href="/res/css/inside_page.css" rel="stylesheet"  type="text/css"/>
</head>

<body>
<div class="container-fluid larry-wrapper">
     <div class="row">
         <div class="col-xs-12 col-sm-12 col-md-12">
             <!--头部搜索-->
             <section class="panel panel-padding">
                    <form class="layui-form">
                        <div class="layui-form">
							<div class="layui-inline emailbox_change">
                                <div class="layui-input-inline">
                                    <select class="" id="emailbox" name="emailbox">
                                    	<option value='sj'>收件箱</option>
                                    	<option value='fj'>发件箱</option>
                                    	<option value='lj'>已删除</option>
							        </select> 
                                </div>
                            </div>
                            <div class="layui-inline sj">
                                <div class="layui-input-inline">
                                    <select class="" id="state" name="">
                                    	<option value='-1'>全部</option>
                                    	<option value='0'>未读</option>
                                    	<option value='1'>已读</option>
							        </select> 
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline">
                                    <input name="start_time" id="start_time" class="layui-input" type="text" onclick="layui.laydate({elem: this})" value="{start_time}" type="text" placeholder="yyyy-mm-dd" autocomplete="off">
                                </div>
                                <div class="layui-input-inline">-</div>
                                <div class="layui-input-inline">
                                    <input name="end_time" id="end_time" class="layui-input" type="text" onclick="layui.laydate({elem: this})" value="{end_time}" type="text" placeholder="yyyy-mm-dd" autocomplete="off">
                                </div>
                            </div>
                            <div class="layui-inline slj">
                                <div class="layui-input-inline">
                                    <input class="layui-input" id="sender" name="sender" value="{sender}" placeholder="发件人">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline">
                                    <input class="layui-input" id="subject" name="subject" value="{subject}" placeholder="邮件主题">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <input type="button" lay-submit class="layui-btn" lay-filter="search" id="btn_search" value="查找"/>
                            </div>
                        </div>
                    </form>
            </section>

            <!--列表-->
                <section class="panel panel-padding">
                    <div class="group-button">
                        <button class="layui-btn layui-btn-small modal-iframe" id="btn_add">
                            <i class="iconfont">&#xe649;</i> 新邮件
                        </button>
                        <button class="layui-btn layui-btn-small layui-btn-danger ajax-all" id="btn_del">
                            <i class="iconfont">&#xe626;</i> 删除
                        </button>
                        <button class="layui-btn layui-btn-small ajax-all lj" id="btn_renew">
                            <i class="iconfont">&#xe653;</i> 恢复
                        </button>
                    </div>
                    <div class="layui-form">
                        <table class="layui-table lay-even sj" style="display: none;">
                            <thead>
                                <tr>
                                    <th width="30"><input type="checkbox" id="checkall" data-name="checkbox" lay-filter="check" lay-skin="primary"></th>
                                    <th width="60">序号</th>
                                    <th width="100">发件人</th>
									<th width="350" title="">主题</th>
									<th width="90">附件</th>
									<th width="170">时间</th>
									<th width="100">重要程度</th>
                                    <th width="80">状态</th>
                                    <th width="150">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                
                                {html}
                               
                            </tbody>
                        </table>
                        <table class="layui-table lay-even fj" style="display: none;">
                            <thead>
                                <tr>
                                    <th width="30"><input type="checkbox" id="checkall" data-name="checkbox" lay-filter="check" lay-skin="primary"></th>
                                    <th width="60">序号</th>
                                    <th width="200">收件人</th>
									<th width="300">主题</th>
									<th width="150">时间</th>
                                    <th width="200">已读</th>
                                    <th width="150">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                
                                {html}
                               
                            </tbody>
                        </table>
                        <table class="layui-table lay-even lj" style="display: none;">
                            <thead>
                                <tr>
                                    <th width="30"><input type="checkbox" id="checkall" data-name="checkbox" lay-filter="check" lay-skin="primary"></th>
                                    <th width="60">序号</th>
                                    <th width="100">发件人</th>
									<th width="250">主题</th>
									<th width="150">时间</th>
                                    <th width="200">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                
                                {html}
                               
                            </tbody>
                        </table>
                    </div>

                    <div class="pagination" id="page">
                        {page}
                    </div>
                </section>
         </div>
     </div>
</div>
   {jsmodel}
   <script type="text/javascript">
   	    if("{emailbox}"=='sj'){
   	    	$(".fj,.lj").remove();
   	        $(".sj").show();
   	    }
   	    if("{emailbox}"=='fj'){
   	    	$(".sj,.lj,.slj").remove();
   	        $(".fj").show();
   	    }
   	    if("{emailbox}"=='lj'){
   	    	$(".fj,.sj").remove();
   	        $(".lj").show();
   	    }
   	    $("#emailbox").val("{emailbox}");
   	    $("#state").val("{state}");
   	    $("#start_time").val("{start_time}");
   	    $("#end_time").val("{end_time}");
   	    $("#sender").val("{sender}");
   	    $("#subject").val("{subject}");
        layui.use('email_sys');
        
        $().ready(function(){
           $("#btn_search").bind("click",function(){   
                var emailbox=$("#emailbox").val();
                var state=($("#state").val()==undefined)?"":$("#state").val();
                var start_time=$("#start_time").val();
                var end_time=$("#end_time").val();
                var sender=($("#sender").val()==undefined)?"":$("#sender").val();
                var subject=$("#subject").val();
                location.href="?t=email_sys&emailbox="+emailbox+"&state="+state+"&start_time="+start_time+"&end_time="+end_time+"&sender="+sender+"&subject="+subject;
            }); 
        });
        
    </script>
</body>
</html>
